package com.example.demo.common;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;//2
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;//3
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;//3
import org.springframework.context.annotation.Configuration;//4



@Configuration
@MapperScan("com.example.demo.mapper")//扫描这个包
public class MybatisPlusConfig {



    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }

}
